import request from '@/utils/request'

export function loginByUsername(username, password) {
  return request({
    url: '/login',
    method: 'post',
    params: {
      username: username,
      password: password
    }
  })
}

export function logout() {
  return request({
    url: '/login/logout',
    method: 'post'
  })
}

export function getUserInfo() {
  return request({
    url: '/user/user-info',
    method: 'get'
  })
}

export function changePassword(password) {
  return request({
    url: '/user/changepwd',
    method: 'post',
    params: {
      password
    }
  })
}
